-- is_dead
--
local import = import
---@type api
local api = import("api/api")
---@type behavior_ret
local bret = import("bt/bt_plugin/behavior3/behavior_ret")

local M = {
    name = "is_dead",
    type = "Condition",
    desc = "是否死亡",
    args = {
        --{ "str", "string", "变量描述" }
    },
}

function M.run(node, env, value)
    local owner = env.owner
    if owner.hp <= 0 or api.is_actor_dead() then
        return bret.SUCCESS
    end
    return bret.FAIL
end

return M
